import request from '@/utils/request'

// 获取列表信息,搜索
export const getRender = function(params) {
  return request({
    url: '/api/vm-service/region/search',
    method: 'GET',
    params
  })
}

// 新增
export const addlist = function(data) {
  return request({
    url: '/api/vm-service/region',
    method: 'POST',
    data
  })
}
// 删除
export const removelist = function(data) {
  return request({
    url: '/api/vm-service/region/' + data.id,
    method: 'DELETE',
    data
  })
}
// 获取详细信息
export const edit = function(regionId) {
  return request({
    url: '/api/vm-service/region/' + regionId,
    method: 'GET'
  })
}
// 修改
export const modifyName = function(data) {
  return request({
    url: '/api/vm-service/region/' + data.id,
    method: 'PUT',
    data
  })
}
// 详情
export const details = function(params) {
  return request({
    url: '/api/vm-service/node/search',
    method: 'GET',
    params
  })
}
// 点位搜索
export const areaSearchList = function(params) {
  return request({
    url: '/api/vm-service/node/search',
    method: 'GET',
    params
  })
}

// 删除点位
export const deletePoint = function(data) {
  return request({
    url: '/api/vm-service/node/' + data.id,
    method: 'DELETE',
    data
  })
}
// 点位详情
export const pointDetail = function(params) {
  return request({
    url: '/api/vm-service/node/vmList/' + params.id,
    method: 'GET',
    params
  })
}
// 弹窗所属商圈
export const dialogBusinessCircle = function() {
  return request({
    url: '/api/vm-service/businessType',
    method: 'GET'
  })
}

// 合作商搜索
export const partnerSearch = function(params) {
  return request({
    url: '/api/user-service/partner/search',
    method: 'GET',
    params
  })
}
// 新增点位
export const newPoint = function(data) {
  return request({
    url: '/api/vm-service/node',
    method: 'POST',
    data
  })
}
// 点位详情
export const pointDetailsModified = function(id) {
  return request({
    url: '/api/vm-service/node/vmList/' + id,
    method: 'GET'
  })
}

// 修改点位
export const modificationPoint = function(data) {
  return request({
    url: '/api/vm-service/node/' + data.id,
    method: 'PUT',
    data
  })
}
// 合作商数据
export const listOfPartners = function(params) {
  return request({
    url: '/api/user-service/partner/search',
    method: 'GET',
    params
  })
}
// 合作商删除
export const partnerRemoval = function(data) {
  return request({
    url: '/api/user-service/partner/' + data.id,
    method: 'DELETE',
    data
  })
}
// 合作商重置密码
export const partnerResetsPassword = function(id) {
  return request({
    url: '/api/user-service/partner/resetPwd/' + id,
    method: 'PUT'
  })
}
// 新增合作商
export const newManager = function(data) {
  return request({
    url: '/api/user-service/partner',
    method: 'POST',
    data
  })
}
// 修改合作商
export const modifyPartner = function(data) {
  return request({
    url: '/api/user-service/partner/' + data.id,
    method: 'PUT',
    data
  })
}
